home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #12 / Amiga Plus CD - 2002 - No. 12.iso / Tools / Freeware / PerfectPaint / rexx / Anim / Slim_Anim.rx < prev   
Encoding:
Text File  |  2001-03-26  |  1.1 KB  |  79 lines

  1. /* Slim_Anim
  2.     Ce script va :
  3.     - construire une animation de 10 images
  4.     - faire un warp sur chaque image.
  5.     - jouer l'animation
  6.     */
  7.  
  8.     options results
  9.     parse ARG Port b
  10.     
  11.     ADDRESS value Port
  12.  
  13.     pp_GetWidth
  14.     width=result
  15.  
  16.     pp_GetHeight
  17.     height=result
  18.  
  19.     IF width=0 & height=0 then DO
  20.         pp_Warn 'Load*a*picture*first'
  21.         EXIT
  22.     END
  23.  
  24.     pp_CountFrames
  25.     nbframe=result
  26.     IF nbframe<2 then DO
  27.         pp_AnimGui 0
  28.         nbframe=result
  29.         IF nbframe<0 then DO
  30.             EXIT
  31.         END                
  32.         pp_MakeAnim nbframe
  33.         pp_CountFrames
  34.         nbframe=result        
  35.         IF result<2 then DO
  36.             pp_Warn "Not*enough*memory"
  37.             EXIT
  38.         END        
  39.     END
  40.  
  41.     radius=50
  42.     pp_DialogInit 150 60 "*Slim*Anim*" 1
  43.         pp_Integer 0 70 8 50 16 "Radius" 1 radius
  44.     pp_Dialog
  45.     rc=result
  46.     IF rc=0 then DO
  47.         EXIT
  48.     END        
  49.  
  50.     pp_GetDialog 0
  51.     radius=result
  52.     
  53.     do i=1 to nbframe
  54.         pp_SetJiffies i 2
  55.         do z=0 to width by radius
  56.             do zz=0 to height by radius
  57.                 Dx=random(0,5,time('S'))
  58.                 Dy=random(0,5,time('S'))
  59.                 a=random(0,5,time('S'))
  60.                 if a>2 then
  61.                     do
  62.                         Dx=Dx*-1
  63.                     end
  64.                 a=random(0,5,time('S'))
  65.                 if a>2 then
  66.                     do
  67.                         Dy=Dy*-1
  68.                     end                
  69.                 pp_Warp z zz radius Dx Dy
  70.             end
  71.         end
  72.         pp_NextFrame
  73.     end
  74.  
  75.     pp_PlayAnim 1
  76.  
  77.     EXIT
  78.  
  79.